package guoanmaker.operator.business.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import guoanmaker.operator.business.model.OperatorTrademarkSearchByUserLogs;
import guoanmaker.operator.business.repository.OperatorTrademarkSearchByUserLogsRepository;

/**
 * 
* @ClassName: OperatorTrademarkSearchByUserLogsService 
* @Description: TODO(商标详情查询) 
* @author (ZhangXinYu)  
* @date 2017年12月18日 下午1:41:57 
* @version V1.0
 */
@Service
public class OperatorTrademarkSearchByUserLogsService implements OperatorTrademarkSearchByUserLogsServiceInterface{
	@Autowired
	private OperatorTrademarkSearchByUserLogsRepository operatorTrademarkSearchByUserLogsRepository;

	@Override
	public void saveSearchLogs(String userid, String regNo, Integer intCls, String data) {
		OperatorTrademarkSearchByUserLogs trademarkSearchByUserLogs = new OperatorTrademarkSearchByUserLogs();
		trademarkSearchByUserLogs.setUserid(userid);
		trademarkSearchByUserLogs.setRegNo(regNo);
		trademarkSearchByUserLogs.setIntCls(intCls);
		trademarkSearchByUserLogs.setData(data);
		operatorTrademarkSearchByUserLogsRepository.save(trademarkSearchByUserLogs);
	}

	@Override
	public Integer deleteSearchLogs(String userid) {
		operatorTrademarkSearchByUserLogsRepository.deleteByUserid(userid);
		return 1;
	}

	@Override
	public List<OperatorTrademarkSearchByUserLogs> findSearchInfo(String userid, String regNo, Integer intCls) {
		return operatorTrademarkSearchByUserLogsRepository.findByUseridAndRegNoAndIntCls(userid, regNo, intCls);
	}
	
}
